﻿using System;
using System.ComponentModel;
using System.Xml;
using System.Xml.Serialization;
using tjb.Utility.Config;


namespace tjb.Utility.Setting
{
    /// <summary>
    /// 
    /// </summary>
    /// 
    [Serializable]
    [Flags]
    public enum CompanyBusinessModel
    {
        /// <summary>
        /// 生产型
        /// </summary>
        /// 
        [Description("生产型")]

        Produce = 16,
        /// <summary>
        /// 贸易型
        /// </summary>
        /// 
        [Description("贸易型")]
        Trading = 1,
        /// <summary>
        /// 服务型
        /// </summary>
        /// 

        [Description("服务型")]
        Service = 2,
        /// <summary>
        /// 政府或事业单位
        /// </summary>
        /// 
        [Description("政府或事业单位")]
        Government = 4,
        /// <summary>
        /// 其他机构
        /// </summary>
        /// 
        [Description("其他机构")]
        Others = 8
    }
    /// <summary>
    /// 
    /// </summary>
    public sealed class ConfigB2bEcom : SystemConfigBase<ConfigB2bEcom>
    {
        

        #region 设置图片信息
        private string _ImgPattern = ".jpg|.gif|.png|.bmp";
        /// <summary>
        /// 上传图片的格式
        /// </summary>
        public string ImgPattern
        {
            get { return _ImgPattern; }
            set { _ImgPattern = value; }
        }
        private long _ImgSize = 200;
        /// <summary>
        /// 上传图片大小 单位k
        /// </summary>
        public long ImgSize
        {
            get { return _ImgSize; }
            set { _ImgSize = value; }
        }

        private int _WidthThumbnailImage = 80;
        /// <summary>
        /// 缩略图最大宽度
        /// </summary>
        public int WidthThumbnailImage
        {
            get { return _WidthThumbnailImage; }
            set { _WidthThumbnailImage = value; }
        }
        private int _HeightThumbnailImage = 80;
        /// <summary>
        /// 缩略图最大高度
        /// </summary>
        public int HeightThumbnailImage
        {
            get { return _HeightThumbnailImage; }
            set { _HeightThumbnailImage = value; }
        }

        private string _PathInnerProduct = "/Images/Product/";
        /// <summary>
        /// 内部公司产品图片路径(相对于应用程序基目录)
        /// 此目录需要IIS账号的写和删除权限
        /// </summary>
        public string PathInnerProduct
        {
            get { return _PathInnerProduct; }
            set { _PathInnerProduct = value; }
        }
        private string __PathInnerQuote = "/Images/Quote/";
        /// <summary>
        /// 内部公司原料（求购信息）图片路径(相对于应用程序基目录)
        /// 此目录需要IIS账号的写和删除权限
        /// </summary>
        public string PathInnerQuote
        {
            get { return __PathInnerQuote; }
            set { __PathInnerQuote = value; }
        }
        private string _PathOuterProduct = "/Images/shopWord/product/";
        /// <summary>
        /// 外部公司产品图片路径(相对于应用程序基目录)
        /// 此目录需要IIS账号的写和删除权限
        /// </summary>
        public string PathOuterProduct
        {
            get { return _PathOuterProduct; }
            set { _PathOuterProduct = value; }
        }
        private string __PathOuterQuote = "/Images/shopWord/Quote/";
        /// <summary>
        /// 内部公司原料（求购信息）图片路径(相对于应用程序基目录)
        /// 此目录需要IIS账号的写和删除权限
        /// </summary>
        public string PathOuterQuote
        {
            get { return __PathOuterQuote; }
            set { __PathOuterQuote = value; }
        }
        #endregion
        /// <summary>
        /// 
        /// </summary>
        [XmlElement("message", Type = typeof(CDATA))]
        public CDATA CData
        {
            get;
            set;
        }



        private CompanyBusinessModel _model = CompanyBusinessModel.Government | CompanyBusinessModel.Others;
        /// <summary>
        /// 
        /// </summary>
        public CompanyBusinessModel Model
        {
            get { return _model; }
            set { _model = value; }
        }

        #region 设置邮件信息
        private int _Port = 25;
        /// <summary>
        /// 发送邮件的端口
        /// </summary>
        public int eMailPort
        {
            get { return _Port; }
            set { _Port = value; }
        }
        private string _FromAddress = "luyang30251@163.com";
        /// <summary>
        /// 发送邮件地址
        /// </summary>
        public string eMailFromAddress
        {
            get { return _FromAddress; }
            set { _FromAddress = value; }
        }
        private string _FromPassWord = "161430251";
        /// <summary>
        /// 发送邮件密码
        /// </summary>
        public string eMailFromPassWord
        {
            get { return _FromPassWord; }
            set { _FromPassWord = value; }
        }
        private string _FromMailServer = "smtp.163.com";
        /// <summary>
        /// 发送邮件服务器
        /// </summary>
        public string eMailFromMailServer
        {
            get { return _FromMailServer; }
            set { _FromMailServer = value; }
        }
        #endregion

        private int _VisitCountMax = int.MaxValue;
        /// <summary>
        /// 浏览次数最大值，如超过此数值
        /// </summary>
        public int VisitCountMax
        {
            get
            {

                return _VisitCountMax;
            }
            set { _VisitCountMax = value; }
        }


        #region 实现抽象方法
        /// <summary>
        /// 
        /// </summary>
        protected override ConfigB2bEcom Current
        {
            get { return this; }
        }
        #endregion

    }

    public sealed class ConfigB2bEcom1 : ConfigBase<ConfigB2bEcom1>
    {
        #region 设置图片信息
        private string _ImgPattern = ".jpg|.gif|.png|.bmp";
        /// <summary>
        /// 上传图片的格式
        /// </summary>
        public string ImgPattern
        {
            get { return _ImgPattern; }
            set { _ImgPattern = value; }
        }
        private long _ImgSize = 200;
        /// <summary>
        /// 上传图片大小 单位k
        /// </summary>
        public long ImgSize
        {
            get { return _ImgSize; }
            set { _ImgSize = value; }
        }

        private int _WidthThumbnailImage = 80;
        /// <summary>
        /// 缩略图最大宽度
        /// </summary>
        public int WidthThumbnailImage
        {
            get { return _WidthThumbnailImage; }
            set { _WidthThumbnailImage = value; }
        }
        private int _HeightThumbnailImage = 80;
        /// <summary>
        /// 缩略图最大高度
        /// </summary>
        public int HeightThumbnailImage
        {
            get { return _HeightThumbnailImage; }
            set { _HeightThumbnailImage = value; }
        }

        private string _PathInnerProduct = "/Images/Product/";
        /// <summary>
        /// 内部公司产品图片路径(相对于应用程序基目录)
        /// 此目录需要IIS账号的写和删除权限
        /// </summary>
        public string PathInnerProduct
        {
            get { return _PathInnerProduct; }
            set { _PathInnerProduct = value; }
        }
        private string __PathInnerQuote = "/Images/Quote/";
        /// <summary>
        /// 内部公司原料（求购信息）图片路径(相对于应用程序基目录)
        /// 此目录需要IIS账号的写和删除权限
        /// </summary>
        public string PathInnerQuote
        {
            get { return __PathInnerQuote; }
            set { __PathInnerQuote = value; }
        }
        private string _PathOuterProduct = "/Images/shopWord/product/";
        /// <summary>
        /// 外部公司产品图片路径(相对于应用程序基目录)
        /// 此目录需要IIS账号的写和删除权限
        /// </summary>
        public string PathOuterProduct
        {
            get { return _PathOuterProduct; }
            set { _PathOuterProduct = value; }
        }
        private string __PathOuterQuote = "/Images/shopWord/Quote/";
        /// <summary>
        /// 内部公司原料（求购信息）图片路径(相对于应用程序基目录)
        /// 此目录需要IIS账号的写和删除权限
        /// </summary>
        public string PathOuterQuote
        {
            get { return __PathOuterQuote; }
            set { __PathOuterQuote = value; }
        }
        #endregion
        /// <summary>
        /// 
        /// </summary>
        [XmlElement("message", Type = typeof(CDATA))]
        public CDATA CData
        {
            get;
            set;
        }



        private CompanyBusinessModel _model = CompanyBusinessModel.Government | CompanyBusinessModel.Others;
        /// <summary>
        /// 
        /// </summary>
        public CompanyBusinessModel Model
        {
            get { return _model; }
            set { _model = value; }
        }

        #region 设置邮件信息
        private int _Port = 25;
        /// <summary>
        /// 发送邮件的端口
        /// </summary>
        public int eMailPort
        {
            get { return _Port; }
            set { _Port = value; }
        }
        private string _FromAddress = "luyang30251@163.com";
        /// <summary>
        /// 发送邮件地址
        /// </summary>
        public string eMailFromAddress
        {
            get { return _FromAddress; }
            set { _FromAddress = value; }
        }
        private string _FromPassWord = "161430251";
        /// <summary>
        /// 发送邮件密码
        /// </summary>
        public string eMailFromPassWord
        {
            get { return _FromPassWord; }
            set { _FromPassWord = value; }
        }
        private string _FromMailServer = "smtp.163.com";
        /// <summary>
        /// 发送邮件服务器
        /// </summary>
        public string eMailFromMailServer
        {
            get { return _FromMailServer; }
            set { _FromMailServer = value; }
        }
        #endregion

        private int _VisitCountMax = int.MaxValue;
        /// <summary>
        /// 浏览次数最大值，如超过此数值
        /// </summary>
        public int VisitCountMax
        {
            get
            {

                return _VisitCountMax;
            }
            set { _VisitCountMax = value; }
        }


        #region 实现抽象方法
        /// <summary>
        /// 
        /// </summary>
        protected override ConfigB2bEcom1 Current
        {
            get { return this; }
        }
        #endregion

    }
}
